import HljsVuePlugin from '@highlightjs/vue-plugin'
import dayjs from 'dayjs'
import timeZone from 'dayjs/plugin/timezone'
import utc from 'dayjs/plugin/utc'
import { createPinia } from 'pinia'
import piniaPluginPersistedState from 'pinia-plugin-persistedstate'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import 'virtual:uno.css'
import '@/assets/styles'
// 引入组件库的少量全局样式变量
import 'highlight.js/styles/atom-one-dark.css'
import 'highlight.js/lib/common'

dayjs.extend(utc)

dayjs.extend(timeZone)
dayjs.tz.setDefault(window.Intl.DateTimeFormat().resolvedOptions().timeZone)

const app = createApp(App)

app.use(router)
const store = createPinia()
store.use(piniaPluginPersistedState)
app.use(store)
app.use(HljsVuePlugin)
app.mount('#resource')
